package com.leyou.constant;

/**
 * @Author lixin
 * @Date 2018/10/24 0024 18:20
 * @Version
 * @Description 封装返回信息（常用的）
 **/
public class Result {

    public static ResponseMessage success() {
        return new ResponseMessage(new Header(200000, "成功"));
    }

    public static ResponseMessage success(Object data) {
        return new ResponseMessage(new Header(200000, "成功"), data);
    }

    public static ResponseMessage success(int resCode, String message) {
        return new ResponseMessage(new Header(resCode, message));
    }

    public static ResponseMessage success(int resCode, String message, Object data) {
        return new ResponseMessage(new Header(resCode, message), data);
    }

    public static ResponseMessage error() {
        return new ResponseMessage(new Header(400000, "失败"));
    }

    public static ResponseMessage error(int resCode, String message) {
        return new ResponseMessage(new Header(resCode, message));
    }
}
